<link rel="stylesheet" href="/stylesheets/login.css">
<div class="form-container">
    <form class="form" role="form">
        <fieldset style="width: 100%">
            <p style="font-size: 20px;margin-top: 20px;font-weight: 400;color: #273238">用户登录</p>
            <div class="control-group">
                <label class="control-label form-item" for="username"></label>
                <div class="controls form-item">
                    <input type="text" placeholder="用户名/手机/邮箱" class="input-xlarge" id="username" name="username">
                </div>
            </div>
            <div class="control-group form-item">
                <label class="control-label" for="password"></label>
                <div class="controls">
                    <input type="password" placeholder="密码" class="input-xlarge" id="password" name="password">
                </div>
            </div>
            <div class="form-actions form-item">
                <button id="login-btn" type="submit" class="btn btn-primary login-btn">登  录</button>
            </div>
        </fieldset>
    </form>
</div>
<script language="JavaScript">
$(document).ready(function(){
    $("form").submit(function(e){
        e.preventDefault();
        var username = $('#username').val();
        var passwd = $('#password').val();
        $.post('/user/login',{username:username,password:passwd},function (data) {
            if (data.code == 0) {
                window.location.href = '<%= redirect %>';
            } else  {
                showError(data.message);
            }
        })
    });
});

</script>